#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdbool.h>
_Bool narcissisticplus(int n)
{
    int number = n;
    int k = 10;
    int count = 0;
    int sum = 0;
    while (count <= 4)
    {
        sum += (n % k) * (n / k);
        k *= 10;
        count++;
    }
    if (sum == n)
        return true;
    else
        return false;
}
int main()
{
    for (int i = 10000; i < 100000; i++)
    {
        if (narcissisticplus(i))
        {
            printf("%d ", i);
        }
    }

    return 0;
}